package com.blate.dogxiao.bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.Objects;

/**
 * @author Az
 * on 2020/12/14
 */
public class CityInfo
        implements Parcelable {

    public String city;                 //成都市
    public String cityName;             //成都
    public String bdCityCode;           //百度SDK城市代码
    public String administrationCode;   //行政编码

    public CityInfo() {
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        CityInfo cityInfo = (CityInfo) o;
        return Objects.equals(cityName, cityInfo.cityName);
    }

    @Override
    public int hashCode() {
        return Objects.hash(cityName);
    }

    protected CityInfo(Parcel in) {
        city = in.readString();
        cityName = in.readString();
        bdCityCode = in.readString();
        administrationCode = in.readString();
    }

    public static final Creator<CityInfo> CREATOR = new Creator<CityInfo>() {
        @Override
        public CityInfo createFromParcel(Parcel in) {
            return new CityInfo(in);
        }

        @Override
        public CityInfo[] newArray(int size) {
            return new CityInfo[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(city);
        dest.writeString(cityName);
        dest.writeString(bdCityCode);
        dest.writeString(administrationCode);
    }
}
